#include <bits/stdc++.h>

#define eb emplace_back
#define in read()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

#define int long long

using ll = long long;

int read() {
	int x = 0; char ch = getchar(); while(!isdigit(ch)) ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }

const int N = 5e4 + 10;
const ll INF = 5e13 + 10;

int n, m, Q;

namespace seg {
	const int N = 4e5 + 10;
	ll tg[N], htg[N], mx[N], hmx[N];
	void pt(int x, ll t1, ll t2) {
		chkmax(htg[x], tg[x] + t2); chkmax(hmx[x], mx[x] + t2);
		tg[x] += t1; mx[x] += t1;
	}
	void pd(int x) {
		if(htg[x] || tg[x])
			pt(x << 1, tg[x], htg[x]), pt(x << 1 | 1, tg[x], htg[x]), tg[x] = htg[x] = 0;
	}
	void pu(int x) { mx[x] = max(mx[x << 1], mx[x << 1 | 1]), hmx[x] = max(hmx[x << 1], hmx[x << 1 | 1]); }
	void update(int xl, int xr, ll v, int o = 1, int l = 1, int r = n) {
		if(xl == l && xr == r) return pt(o, v, max(v, 0ll)); int mid = (l + r) >> 1; pd(o);
		if(xr <= mid) update(xl, xr, v, o << 1, l, mid); else if(xl > mid) update(xl, xr, v, o << 1 | 1, mid + 1, r);
		else update(xl, mid, v, o << 1, l, mid), update(mid + 1, xr, v, o << 1 | 1, mid + 1, r);
		pu(o);
	}
	ll query(int xl, int xr, int o = 1, int l = 1, int r = n) {
		if(xl == l && xr == r) return hmx[o]; int mid = (l + r) >> 1; pd(o);
		if(xr <= mid) return query(xl, xr, o << 1, l, mid); else if(xl > mid) return query(xl, xr, o << 1 | 1, mid + 1, r);
		else return max(query(xl, mid, o << 1, l, mid), query(mid + 1, xr, o << 1 | 1, mid + 1, r));
	}
}

using seg :: query;
using seg :: update;

ll ccnt = 0;
ll ans[N * 20];

void clear() { update(1, n, INF); ccnt++; }
void work(const auto &upd, int op) { for(auto v : upd) update(v.y1, v.y2, v.v * op); }
void answer(const auto &qry) { for(auto v : qry) chkmax(ans[v.v], query(v.y1, v.y2) - ccnt * INF); }

struct node {
	int x1, y1, x2, y2, v;
	node(int _x1 = 0, int _y1 = 0, int _x2 = 0, int _y2 = 0, int _v = 0) : x1(_x1), y1(_y1), x2(_x2), y2(_y2), v(_v) {}
};

vector < node > qry[N], ins[N], era[N];

void solve(const auto &cupd, const auto &cqry, int l, int r) {
	if(!cqry.size()) return; int mid = (l + r) >> 1;
	if(l == r) return work(cupd, 1), answer(cqry), work(cupd, -1), clear();
	rep(i, l - 1, r + 1) qry[i].clear(), ins[i].clear(), era[i].clear();
	vector < node > qryl, qryr, totl, updl, totr, updr;
	for(const auto &v : cqry) {
		if(v.x2 <= mid) qryl.eb(v);
		else if(v.x1 > mid) qryr.eb(v);
		else qry[v.x1].eb(v), qry[v.x2].eb(v);
	}
	for(const auto &v : cupd) {
		if(v.x2 <= mid) ins[v.x2].eb(v), era[v.x1 - 1].eb(v);
		else if(v.x1 > mid) ins[v.x1].eb(v), era[v.x2 + 1].eb(v);
		else ins[mid].eb(v), ins[mid + 1].eb(v), era[v.x1 - 1].eb(v), era[v.x2 + 1].eb(v);
	}
	per(i, mid, l - 1) work(era[i], -1), work(ins[i], 1), answer(qry[i]); clear();
	rep(i, mid + 1, r + 1) work(era[i], -1), work(ins[i], 1), answer(qry[i]); clear();
	for(auto v : cupd) {
		if(v.x2 <= mid) (v.x1 == l && v.x2 == mid ? totl : updl).eb(v);
		else if(v.x1 > mid) (v.x1 == mid + 1 && v.x2 == r ? totr : updr).eb(v);
		else (v.x1 == l ? totl : updl).eb(v.x1, v.y1, mid, v.y2, v.v), (v.x2 == r ? totr : updr).eb(mid + 1, v.y1, v.x2, v.y2, v.v);
	}
	work(totl, 1); solve(updl, qryl, l, mid); work(totl, -1); clear();
	work(totr, 1); solve(updr, qryr, mid + 1, r); work(totr, -1); clear();
}

signed main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in, m = in, Q = in; vector < node > qry, upd;
	int l1, r1, l2, r2, x;
	rep(i, 1, m) l1 = in, r1 = in, l2 = in, r2 = in, x = in, upd.eb(l1, r1, l2, r2, x);
	rep(i, 1, Q) l1 = in, r1 = in, l2 = in, r2 = in, x = i,  qry.eb(l1, r1, l2, r2, x); 
	solve(upd, qry, 1, n); rep(i, 1, Q) printf("%lld\n", ans[i]);
	return 0;
}
